// home首页模块仓库
import {
    reqCategoryList
} from "@/api"
// status 存储数据
const state = {
    // state 中的初始值
    categoryList: []
};
// mutations 修改 state
const mutations = {
    CATEGORYLIST(state, categoryList) {
        state.categoryList = categoryList;
    }
};
// actions 书写业务逻辑
const actions = {
    // 三级联动菜单请求发送
   async categoryList({commit}) {
        let result =await reqCategoryList();
        if (result.code == 200) {
            commit('CATEGORYLIST', result.data);
        }
    }
};
// getter 计算属性
const getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}